package chixing.day06.homework;

public class VIPUserTest {
    /**
     * 创建一个 VIPUser[]，加入多个 VIP 用户对象。
     * 遍历数组，输出每个用户的用户名与是否能参加特卖活动（通过判断 canAccessSpecialSale()）
     *
     */
    public static void main(String[] args) {
        VIPUser vipUser1 = new VIPUser("aaa",45,2);
        VIPUser vipUser2 = new VIPUser("bbb",32,5);
        VIPUser vipUser3 = new VIPUser("ccc",46,1);
        VIPUser vipUser4 = new VIPUser("ddd",57,3);

        VIPUser[] vipUsers = {vipUser1,vipUser2,vipUser3,vipUser4};

        for (VIPUser vipUser:vipUsers) {
            if (vipUser.canAccessSpecialSale()){
                System.out.println(vipUser.getUserName() + "可以参加特卖活动");
            }else
                System.out.println(vipUser.getUserName() + "不可以参加特卖活动");
        }
    }
}
